/*cusrse*/
function ht(){
		document.getElementById("course").src="img/kecheng.png";
	}

/*setting设置*/
function st(){
	document.getElementById("setting").src="img/shezhi (1).png";
}

/*登录*/
function login(){
	document.querySelector("#logi").src="img/accountnumber.png";
}

//轮播图
var swiper = new Swiper('.swiper-container', {
	spaceBetween: 50,
	slidesPerView: 1,
	navigation: {
	    nextEl: '.swiper-button-next',
	    prevEl: '.swiper-button-prev',
	},
	pagination: {
	    el: '.swiper-pagination',
	},
	history: {
	    key: 'slide',
	},
});		
	    

/*热门排行榜倒计时*/
function getRtime(){
	var endTime = new Date('2020/7/30 00:00:00');//截至时间
	var nowTime = new Date();
	var t =  endTime.getTime() - nowTime.getTime();
	var d = Math.floor(t/1000/60/60/24);
	var h = Math.floor(t/1000/60/60%24);
	var m = Math.floor(t/1000/60/60%60);
	var s = Math.floor(t/1000%60);
	document.getElementById("dt").innerHTML = "倒计时:"+d+"天"+h+"时"+m+"分"+s+"秒";
}
setInterval(getRtime,1000);

/*js限时抢购换图*/
var dt = document.getElementById("dt");
var dt2 = document.getElementById("dt2");
var dt3 = document.getElementById("dt3");
var dt4 = document.getElementById("dt4");
	dt.onclick = function(){
		document.getElementById("dt").style.backgroundColor="#1296db";
		document.getElementById("dt").style.color="white";
		document.getElementById("dt2").style.backgroundColor="#CCEBFF";
		document.getElementById("dt2").style.color="#4D4D4D";
		document.getElementById("dt3").style.backgroundColor="#CCEBFF";
		document.getElementById("dt3").style.color="#4D4D4D";
		document.getElementById("dt4").style.backgroundColor="#CCEBFF";
		document.getElementById("dt4").style.color="#4D4D4D";
		document.getElementById("img111").src="img/HTML入门系列.png";
		document.getElementById("img222").src="img/ui设计.png";
		document.getElementById("img333").src="img/数据.png";
		document.getElementById("img444").src="img/Excel入门.png";
		document.getElementById("img555").src="img/Python入门.jpg";
		document.getElementById("text1").innerHTML="HTML入门系列";
		document.getElementById("text2").innerHTML="UI设计入门系列";
		document.getElementById("text3").innerHTML="大数据入门系列";
		document.getElementById("text4").innerHTML="Excel入门系列";
		document.getElementById("text5").innerHTML="Python入门系列";
	}
	dt2.onclick = function(){
		document.getElementById("dt").style.backgroundColor="#CCEBFF";
		document.getElementById("dt").style.color="#4D4D4D";
		document.getElementById("dt2").style.backgroundColor="#1296db";
		document.getElementById("dt2").style.color="white";
		document.getElementById("dt3").style.backgroundColor="#CCEBFF";
		document.getElementById("dt3").style.color="#4D4D4D";
		document.getElementById("dt4").style.backgroundColor="#CCEBFF";
		document.getElementById("dt4").style.color="#4D4D4D";
		document.getElementById("img111").src="img/Vue框架.png";
		document.getElementById("img222").src="img/Web前端框架.png";
		document.getElementById("img333").src="img/PHP从小白到入门.jpg";
		document.getElementById("img444").src="img/入门插画教学.jpg";
		document.getElementById("img555").src="img/Android移动开发.jpg";
		document.getElementById("text1").innerHTML="手把手教授Vue框架";
		document.getElementById("text2").innerHTML="Web前端指导学习";
		document.getElementById("text3").innerHTML="PHP从小白到入门";
		document.getElementById("text4").innerHTML="入门插画教学";
		document.getElementById("text5").innerHTML="Android移动开发";
	}
	dt3.onclick = function(){
		document.getElementById("dt").style.backgroundColor="#CCEBFF";
		document.getElementById("dt").style.color="#4D4D4D";
		document.getElementById("dt2").style.backgroundColor="#CCEBFF";
		document.getElementById("dt2").style.color="#4D4D4D";
		document.getElementById("dt3").style.backgroundColor="#1296db";
		document.getElementById("dt3").style.color="white";
		document.getElementById("dt4").style.backgroundColor="#CCEBFF";
		document.getElementById("dt4").style.color="#4D4D4D";
		document.getElementById("img111").src="img/JAVA架构师.png";
		document.getElementById("img222").src="img/ipad插画.jpg";
		document.getElementById("img333").src="img/ios开发.jpg";
		document.getElementById("img444").src="img/原画CG.jpg";
		document.getElementById("img555").src="img/平面设计.jpg";
		document.getElementById("text1").innerHTML="Java架构师";
		document.getElementById("text2").innerHTML="iPad插画入门";
		document.getElementById("text3").innerHTML="ios开发进阶";
		document.getElementById("text4").innerHTML="原画CG";
		document.getElementById("text5").innerHTML="平面设计";
	}
	dt4.onclick = function(){
		document.getElementById("dt").style.backgroundColor="#CCEBFF";
		document.getElementById("dt").style.color="#4D4D4D";
		document.getElementById("dt2").style.backgroundColor="#CCEBFF";
		document.getElementById("dt2").style.color="#4D4D4D";
		document.getElementById("dt3").style.backgroundColor="#CCEBFF";
		document.getElementById("dt3").style.color="#4D4D4D";
		document.getElementById("dt4").style.backgroundColor="#1296db";
		document.getElementById("dt4").style.color="white";
		document.getElementById("img111").src="img/AI图标.png";
		document.getElementById("img222").src="img/PS从入门到精通.jpg";
		document.getElementById("img333").src="img/word技巧.jpg";
		document.getElementById("img444").src="img/新媒体运营.png";
		document.getElementById("img555").src="img/微信小程序.png";
		document.getElementById("text1").innerHTML="AI图标绘画";
		document.getElementById("text2").innerHTML="PS实操小技巧";
		document.getElementById("text3").innerHTML="WPS技巧";
		document.getElementById("text4").innerHTML="新媒体运营师";
		document.getElementById("text5").innerHTML="微信小程序开发";
	}
	


//音乐开启与关闭
window.onload = function() {
				/*右上角音乐及图标*/
				var flag = 1; //开启音乐
				var music = document.getElementById('music');
				var rallback = document.getElementById('rallback');

				rallback.onclick = function() {                                                            //把rallback 改成window是表示整个计算机窗口
					if(flag == 1) {
						music.pause(); /*音乐关闭*/
						flag = 0;
						rallback.style.webkitAnimationPlayState = "paused"; //旋转动画暂停
					} else {
						music.play(); /*音乐开启*/
						flag = 1;
						rallback.style.webkitAnimationPlayState = "running"; //旋转动画暂停
					}
				}

				/*不允许有多个onload*/
				/*控制选项卡切换*/
				var myTab = document.getElementById("tab"); //整个div
				var myUl = myTab.getElementsByTagName("ul")[0]; //一个节点
				var myLi = myUl.getElementsByTagName("li"); //数组
				var myDiv = myTab.getElementsByTagName("div"); //数组

				for(var i = 0; i < myLi.length; i++) {
					myLi[i].index = i;
					myLi[i].onclick = function() {
						for(var j = 0; j < myLi.length; j++) {
							myLi[j].className = "off";
							myDiv[j].className = "hide";
						}
						this.className = "on";
						myDiv[this.index].className = "show";
					}
				}

			}
	
	
/*@meida only screen and (max-height:){
	
}*/
